function handle(str) {
  let length = str.length
  for (let i = 0; i < length / 2; i++){
    str = str.replace('{}','').replace('[]','').replace('()','')
  }
  return str.length === 0
}

console.log(handle("(]"))
